package com.yunji.aggregate.mapper;

import com.yunji.aggregate.model.dto.analysis.*;
import com.yunji.aggregate.model.dto.base.*;
import com.yunji.aggregate.model.dto.stock.StatisticsDataParam;
import com.yunji.aggregate.model.vo.analysis.*;
import com.yunji.aggregate.model.vo.base.*;
import com.yunji.common.annotation.DataScope;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author : peter-zhu
 * @date : 2024/12/6 16:33
 * @description : TODO
 **/
public interface IBaseAggregateMapper {
    List<BelongStatisticsVO> belongList(BelongParam param);

    List<AgentVO> agentList(AgentParam agentParam);

    List<AgentSalesVO> agentScalesList(StatisticsDataParam param);

    List<AgentEarnsVO> agentEarnsList(StatisticsDataParam param);

    List<MemberDTO> memberList(MemberDTO member);

    @DataScope
    List<SiteStatisticsVO> siteList(SiteParam param);

    @DataScope
    List<SiteSalesStatisticsVO> siteSalesList(StatisticsDataParam param);

    @DataScope
    List<SiteEarnsStatisticsVO> siteEarnsList(StatisticsDataParam param);

    @DataScope(excludeTables = "s_agent_user")
    List<StaffStatisticsVO> staffList(StaffParam param);

    @DataScope
    List<LinkageQueryVO> containerLinkageQuery(LinkageQueryParam param);

    @Select({"<script>select * from tc_site_scale_config where site_id in ",
            "<foreach collection='siteIds' item='siteId' open='(' close=')' separator=','>",
            "#{siteId}</foreach></script>"})
    List<SiteScaleVO> listScaleBySiteIds(@Param("siteIds") List<Long> siteIds);

    @DataScope
    List<SiteLocationStatisticsVO> getSiteLocationVOList(SiteLocationStatisticsParam param);

    @DataScope
    List<String> searchFiled(SiteLocationFiledDTO dto);

    List<LocationSalesStatsVO> locationSalesStats(LocationSalesStatsParam param);

    List<LocationSalesChartVO> locationSalesChart(LocationSalesStatsParam param);

    List<ContainerSalesStatsVO> containerSalesStats(ContainerSalesStatsParam param);

    List<ContainerSalesChartVO> containerSalesChart(ContainerSalesStatsParam param);

    List<StaffDataStatsVO> staffDataStats(StaffDataStatsParam param);
}
